<?php
namespace app\serverauthcode\service\authcode;
use \app\manage\service\ApiBase;
use think\Validate;

class ApiAuthCode extends ApiBase
{

    protected $authcodeValidate = 'app\serverauthcode\validate\AuthCode';
    protected $authcodeLogic    = '\app\serverauthcode\logic\AuthCode';

    public function createAuthCode()
    {
        $data = $this->haveIssetReceiveData(["token"=>" ", "type"=>"", "code_id"=>"", "fontSize"=>25, "useCurve"=>1, "imageH"=>62, "imageW"=>250, "length"=>5]);
        $data['appkey'] = config('yayi_admin_app_key');
        return $this->oneStepRun($data, 'serverauthcode/authcode/ApiAuthCode/createAuthCode', 'createAuthCode', '1', $this->authcodeValidate, $this->authcodeLogic);
    }

    public function verifyAuthCode()
    {
        $data = $this->haveIssetReceiveData(["token"=>" ", "type"=>"", "code_id"=>"", "auth_code"=>""]);
        $data['appkey'] = config('yayi_admin_app_key');
        return $this->oneStepRun($data, 'serverauthcode/authcode/ApiAuthCode/verifyAuthCode', 'verifyAuthCode', '1', $this->authcodeValidate, $this->authcodeLogic);
    }
}